﻿@{
    Layout = "~/Views/Shared/_IndexLayout.cshtml";
    ViewBag.Title = "学生管理";
}
@using prince.CSSDemo.Models
@model List<OrderMenu>
<script type="text/javascript">
    //增加标签 title：标签名 必须唯一  url：请求地址，会使用Ajax调用此地址，并将内容展现在标签中
    function addTab(title, url) {
        if ($('#tab').tabs('exists', title)) {
            $('#tab').tabs('select', title);
        }
        else {
            $('#tab').tabs('add', {
                title: title,
                closable: true,
                content: '<iframe scrolling="yes" frameborder="0"  src="' + url + '" style="width:100%;height:99%;"></iframe>'
            });
        }
    }
</script>

@helper AddButton(string title, string action)
{
    <a href="javasrcipt:;" class="easyui-linkbutton" data-options="plain:true, iconCls:'icon-mini-add'" style="width: 180px; text-align: left; margin: 3px;" onclick="addTab('@title', '@action');">@title</a>
}
<div data-options="region:'west', collapsible:true,title:'学生管理'" id="leftMenu" class="easyui-accordion" style="width:25%; max-width:200px;">
    @foreach (var fun in Model)
    {
        <div title="@fun.parentName">
            @foreach (var subFun in fun.menu)
                {
                @AddButton(subFun.funName, subFun.url);
                }
        </div>
    }
</div>

<!--主页面容器-->
<div class="easyui-tabs" data-options="region:'center',fit:'true'" id="tab">
</div>
